<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>中国证券会证券期货违法违规举报中心-注册</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="shortcut icon" type="image/x-icon"
	href="<%=request.getContextPath()%>/images/favicon.ico" />
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/main.css">
<link
	href="<%=request.getContextPath()%>/formValidator1/style/validator.css"
	rel="stylesheet" type="text/css" />
<style type="text/css">
button {
	background: #F0F0F0 repeat-x;
	padding-top: 3px;
	border-top: 1px solid #708090;
	border-right: 1px solid #708090;
	border-bottom: 1px solid #708090;
	border-left: 1px solid #708090;
	width: auto;
	line-height: 12pt;
	font-size: 10pt;
	cursor: hand;
	font-size: 10pt;
	border-top: 1px solid #708090;
}
</style>
<script src="<%=request.getContextPath()%>/js/jquery-1.7.2.min.j"
	type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/formValidator1/formValidator-4.0.1.js"
	type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/formValidator1/formValidatorRegex.js"
	type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/register.js"
	type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/sms.js"
	type="text/javascript"></script>
<script type="text/javascript">
	function changeCheckNum() {
		var checkNumImage_ = document.getElementById("checkNumImage");
		checkNumImage_.src = "${pageContext.request.contextPath}/image.jsp?timeStamp="
				+ new Date().getTime();
	}
</script>
<script type="text/javascript">
	var msg = "${message}";
	if (msg != "") {
		alert(msg);
	}
	
	function trim(str) {  
	    var strnew = str.replace(/^\s*|\s*$/g, "");  
	    return strnew;  
	}  
	//用户名  
	function checkusername() {  
	    var username = document.form1.username.value;  
	    if (username == "" || !isNaN(username.charAt(0))) {  
	        document.getElementById("usernameTip").innerHTML = "<font color='red'>× 首字母不能为数字或者用户名不能为空</font>";  
	        return false;  
	    } else if (username.length < 6 || username.length > 30) {  
	        document.getElementById("usernameTip").innerHTML = "<font color='red'>× 用户名长度为6-30位字符</font>";  
	        return false;  
	    } else {  
	        document.getElementById("usernameTip").innerHTML = "<font color='#339933'>√ 用户名合格</font>";  
	        // 向后台发送处理数据  
	        $.ajax({  
	            url : "UserAction_checkUserName.action",// 目标地址  
	            data : {username : username}, // 目标参数  
	            type : "POST", // 用POST方式传输  
	            dataType : "text", // 数据格式:text  
	            success : function(data) {  
	                data = parseInt(data, 10);  
	                if (data != 0) {  
	                    $("#usernameTip").html("<font color='red'>× 该用户名已经被注册，请重新输入</font>");  
	                } else {  
	                    $("#usernameTip").html("<font color='#339933'>√ 该用户名可以注册，输入正确</font>");  
	                }  
	            }  
	        });  
	        return true;  
	    }  
	}  
	// 登录密码  
	function checkpassword() {  
	    var password = document.form1.password.value;  
	    if (password.length < 6 || password.length > 30) {  
	        document.getElementById("passwordTip").innerHTML = "<font color='red'>× 密码长度不能小于6位，大于30位</font>";  
	        return false;  
	    } else if (!isNaN(password)) {  
	        document.getElementById("passwordTip").innerHTML = "<font color='red'>× 密码不能全是数字</font>";  
	        return false;  
	    } else {  
	        document.getElementById("passwordTip").innerHTML = "<font color='#339933'>√ 密码合格</font>";  
	        return true;  
	    }  
	}  
	// 确认密码  
	function checkpasswrodb() {  
	    var password = document.form1.password.value;  
	    var passwordRepeat = document.form1.passwordRepeat.value;  
	    if (trim(password) != trim(passwordRepeat)) {  
	        document.getElementById("passwordRepeatTip").innerHTML = "<font color='red'>× 两次密码输入必须一致</font>";  
	        return false;  
	    } else {  
	        document.getElementById("passwordRepeatTip").innerHTML = "<font color='#339933'>√ 密码输入一致</font>";  
	        return true;  
	    }  
	}  
	
</script>
</head>
<body>
	<div class="center_division">
		<div class="center_body">
			<div class="center_menu">
				<font color="#000000">当前位置：</font><font color="#000000">用户注册</font></a>
			</div>
		</div>
		<div class="center_body_menu">
			<s:form action="RegisterAction_register" id="form1" name="form1"
				method="post" namespace="/">
				<table id="tb">
					<tr>
						<td colspan="3" align="center" bgcolor="#DDDFE1">举报人基本信息</td>
					</tr>
					<tr>
						<td align="center" width="30%"><img
							src="images/new_reg_xing.gif" />用户名：</td>
						<td align="center" width="40%"><input type="text"
							name="username" id="username" cssStyle="width:160px;height:24px;"
							onblur="checkusername()" /></td>
						<td align="left" width="30%"><span id="usernameTip"> <s:fielderror
									cssStyle="color:red;padding-left:10px;">
									<s:param>username</s:param>
								</s:fielderror>
						</span></td>
					</tr>
					<tr>
						<td align="center" width="30%"><img
							src="images/new_reg_xing.gif" />登录密码：</td>
						<td align="center" width="40%"><input type="text"
							name="password" id="password" cssStyle="width:160px;height:24px;"
							onblur="checkpassword()" /></td>
						<td align="left" width="30%"><span id="passwordTip"> <s:fielderror
									cssStyle="color:red;padding-left:10px;">
									<s:param>password</s:param>
								</s:fielderror>
						</span></td>
					</tr>
					<tr>
						<td align="center" width="30%"><img
							src="images/new_reg_xing.gif" />确认密码：</td>
						<td align="center" width="40%"><input type="text"
							name="passwordRepeat" id="passwordRepeat"
							cssStyle="width:160px;height:24px;" onblur="checkpasswrodb()" />
						</td>
						<td align="left" width="30%"><span id="passwordRepeatTip">
								<s:fielderror cssStyle="color:red;padding-left:10px;">
									<s:param>passwordRepeat</s:param>
								</s:fielderror>
						</span></td>
					</tr>
					<tr>
						<td colspan="3"
							style="vertical-align: top; padding-top: 5px; padding-bottom: 5px;">
							<input type="submit" value="注册"
							style="width: 50px; height: 24px;" /> <input type="reset"
							value="重置" style="width: 50px; height: 24px;" />
						</td>
					</tr>
				</table>
			</s:form>
		</div>
	</div>
</body>
</html>
